package com.zzc.interview.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzc.interview.model.dto.ojQuestion.OjQuestionQueryRequest;
import com.zzc.interview.model.entity.OjQuestion;
import com.zzc.interview.model.entity.User;
import com.zzc.interview.model.vo.OjQuestionVO;

/**
 *
 */
public interface OjQuestionService extends IService<OjQuestion> {
    /**
     * 校验
     *
     * @param question
     * @param add
     */
    void validOjQuestion(OjQuestion question, boolean add);

    /**
     * 获取查询条件
     *
     * @param questionQueryRequest
     * @return
     */
    QueryWrapper<OjQuestion> getQueryWrapper(OjQuestionQueryRequest questionQueryRequest);

    /**
     * 获取题目封装
     *
     * @param question
     * @param loginUser
     * @return
     */
    OjQuestionVO getOjQuestionVO(OjQuestion question, User loginUser);

    /**
     * 分页获取题目封装
     *
     * @param questionPage
     * @param loginUser
     * @return
     */
    Page<OjQuestionVO> getOjQuestionVOPage(Page<OjQuestion> questionPage, User loginUser);

    /**
     * 获取题目的所有信息
     * @param questionPage
     * @param user
     * @return
     */
    Page<OjQuestion> getOjQuestionPage(Page<OjQuestion> questionPage, User user);
}
